package o;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences.Editor;
import com.huawei.appgallery.push.api.bean.ImeiDeviceTokenResBean;
import com.huawei.appgallery.push.api.bean.ImeiDeviceTokenResBean$DeviceTokenResponse;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import java.util.List;

public class eeq implements cue<String>, IServerCallBack {
    private Context ˏ;

    public void ˋ(Context context, String str) {
        this.ˏ = context;
        cvt o_cuj = new cuj(str);
        if (this.ˏ instanceof Activity) {
            o_cuj.setServiceType_(dgm.ˎ((Activity) this.ˏ));
        }
        cfw.ˎ(o_cuj, this);
    }

    public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
        if (responseBean instanceof ImeiDeviceTokenResBean) {
            boolean z;
            List list = ((ImeiDeviceTokenResBean) responseBean).list_;
            if (CollectCheck.isEmpty(list)) {
                Logger.e("PushTokenHandler", "PushDeviceTokenService uploadDeviceToken response list is null");
                z = false;
            } else {
                ImeiDeviceTokenResBean$DeviceTokenResponse imeiDeviceTokenResBean$DeviceTokenResponse = (ImeiDeviceTokenResBean$DeviceTokenResponse) list.get(0);
                if (responseBean.getResponseCode() == 0 && "true".equals(imeiDeviceTokenResBean$DeviceTokenResponse.flag_)) {
                    z = true;
                }
                z = false;
            }
            Editor edit = this.ˏ.getSharedPreferences("PluginInfo", 0).edit();
            edit.putBoolean("is_register_succeed", z);
            edit.commit();
        }
    }

    public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
    }
}
